|
|
|
| |
|
|
|
|
Although it is possible to delete all the objects from the Default user profile, it is not recommended. Doing so makes it impossible to add or edit existing access rights of other new users. |
|
|
|
|
|
|
|
|
|
|
Implementing Access Rights Security in Your Application |
|
|
|
|
|
|
|
|
Now that you have the tools to create and manage user access rights, you need to build a routine to check those user rights and then add rights-checking to a working Visual Basic application. |
|
|
|
|
|
|
|
|
First, you add two new methods to the PRJUSROBJECT DLL file. The first procedure (CheckRights) is the main routine that verifies the user's rights to an object. The second routine (LoadRights) is a support routine that is called by CheckRights. You also need to add some more code to the general declarations portion of the 4class module (see Listing 21.30). Place this right after the code you added for the Login/Logout features of the class. |
|
|
|
|
|
|
|
|
Listing 21.30. Adding code to the declarations section of the UsrObject class module. |
|
|
|
|
|
|
|
|
'
' user access verification vars
Private wsRights As Workspace
Private dbRights As Database
Private rsRights As Recordset
Private blnRightsLoaded As Boolean
'
Enum urLevel
urNone = 0
urReadOnly = 1
urReadModify = 2
urReadModAdd = 3
urReadModAddDel = 4
urextended = 5
End Enum |
|
|
|
|
|
|
|
|
Now add the method that loads the dataset into local objects. Enter the code from Listing 21.31 into your project. |
|
|
|
|
|